package com.slkj.shilixiaoyuanapp.ui.parent.tool.bodyartspecialty;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.TextView;

import com.example.api.InjectParam;
import com.slkj.shilixiaoyuanapp.R;
import com.slkj.shilixiaoyuanapp.base.ActivityInfo;
import com.slkj.shilixiaoyuanapp.base.BaseActivity;
import com.slkj.shilixiaoyuanapp.entity.parent.SingleBodyartspecialtyEntity;
import com.slkj.shilixiaoyuanapp.ui.common.ChosePeopleActivity;
import com.slkj.shilixiaoyuanapp.ui.common.adapter.ChosePicAdapter;

import butterknife.BindView;

import static com.slkj.shilixiaoyuanapp.entity.code.UiCode.CHOSE_PIC_SPAN_COUNT;

@ActivityInfo(layout = R.layout.activity_specialty_passed,title = "已通过")
public class SpecialtyPassedActivity extends BaseActivity {
    @InjectParam
    int id;
    @InjectParam
    SingleBodyartspecialtyEntity data;
    @BindView(R.id.tv_student_name)
    TextView tv_user_name;
    @BindView(R.id.tv_organisers)
    TextView tv_organisers;
    @BindView(R.id.tv_winning_name)
    TextView tv_winning_name;
    @BindView(R.id.tv_win_level)
    TextView tv_win_level;
    @BindView(R.id.tv_winning_level)
    TextView tv_winning_level;
    @BindView(R.id.tv_winning_time1)
    TextView tv_winning_time1;
    @BindView(R.id.tv_winning_type1)
    TextView tv_winning_type1;
    @BindView(R.id.recyc_pic)
    RecyclerView recyc_pic;
    @BindView(R.id.tv_spr)
    TextView tv_spr;
    ChosePicAdapter adapter;
    @Override
    protected void init() {
        SpecialtyPassedActivity__JumpCenter.bind(this);
        tv_user_name.setText(data.getStudentName());
        tv_organisers.setText(data.getHostUnit());
        tv_winning_name.setText(data.getName());
        tv_win_level.setText(data.getAwardLevel().getAName());
        tv_winning_level.setText(data.getLevel().getLName());
        tv_winning_time1.setText(data.getPrizeTime());
        if (data.getBigType()==1) {
            tv_winning_type1.setText("艺术类");
        }else {
            tv_winning_type1.setText("体育类");
        }
        if (data.getImage()!= null && !data.getImage().isEmpty()){
            recyc_pic.setLayoutManager(new GridLayoutManager(this, CHOSE_PIC_SPAN_COUNT));
            adapter = new ChosePicAdapter(data.getImage(), this,false);
            recyc_pic.setAdapter(adapter);
        }
        tv_spr.setText(ChosePeopleActivity.getPeoplesInfos1(data.getAuditor()));
    }
}
